# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Damir Perisa <damir@archlinux.org>

pkgname=maxima
pkgver=5.45.1
pkgrel=3
pkgdesc="A sophisticated computer algebra system"
arch=('x86_64')
license=('GPL')
url="http://maxima.sourceforge.net"
depends=('sbcl=2.1.7' 'texinfo' 'sh' 'shared-mime-info')
makedepends=('python' 'emacs')
optdepends=('gnuplot: plotting capabilities' 'rlwrap: readline support via /usr/bin/rmaxima' 'tk: graphical xmaxima interface')
# needs rebuild when bash changes version
# needs a rebuild when sbcl changes version
options=('!makeflags' '!zipman') # don't zip info pages or they won't work inside maxima
source=("https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz")
sha1sums=('a259f53b0362b77e6a642cf5b5d55aa35c0a483a')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info \
	--libexecdir=/usr/lib --enable-sbcl --with-default-lisp=sbcl

  # help avoid (re)running makeinfo/tex
  touch doc/info/maxima.info
  make
}

#check() {  # test 23&129 fail from rtest_taylor
#  cd "${srcdir}/${pkgname}-${pkgver}"
#  make check
#}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" emacsdir=/usr/share/emacs/site-lisp/maxima install
}
